I would like to generate a continuous variable at the firm level. For the sample below, I would like to generate a new variable that illustrates the percentage of employees that are "female, older than 22, have a master degree " to employees that are "Older than 22 and have master degree" for each firm-year observation.
companyid | year | employeeid | Female, older than 22 and have master degree | Female, older than 22 and have a master degree |
293475073 | 2005 | 10 | 1 | 1 |
293475073 | 2005 | 11 | 0 | 0 |
293475073 | 2005 | 5 | 1 | 1 |
982726482 | 2005 | 12 | 0 | 0 |
982726482 | 2005 | 11 | 0 | 0 |
982726482 | 2005 | 5 | 1 | 1 |
23452345234 | 2006 | 10 | 1 | 1 |
23452345234 | 2006 | 6 | 0 | 0 |
23452345234 | 2006 | 7.00E+00 | 1 | 0 |
18938422 | 2006 | 8.00E+00 | 1 | 0 |
18938422 | 2006 | 6 | 0 | 0 |
18938422 | 2006 | 1.50E+01 | 0 | 0 |
18938422 | 2006 | 1.60E+01 | 1 | 0 |
980232133 | 2007 | 1.70E+01 | 1 | 1 |
980232133 | 2007 | 1.80E+01 | 0 | 0 |
3456546 | 2007 | 1.90E+01 | 0 | 0 |
3456546 | 2007 | 1.70E+01 | 1 | 1 |
Comment